package com.example.shop.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
* <p>
* 商品
* </p>
*
* @author 作者
* @since 2022-05-29
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("goods")
public class Goods extends Model<Goods> {

  private static final long serialVersionUID = 1L;

  @TableId(value = "goods_id", type = IdType.ASSIGN_ID)
  //商品的唯一标识
  private Long goodsId;
  //该商品归属的商家的唯一标识
  private Long merchantId;
  //商品的类型
  private String goodsType;
  //商品名
  private String goodsName;
  //商品的视频介绍
  private String goodsVideo;
  //商品的简介
  private String goodsIntroduction;
  //该商品的好评数
  private int favorableCommentNumber;
  //该商品的中评数
  private int mediumCommentNumber;
  //该商品的差评数
  private int badCommentNumber;
  //该商品的上架时间
  private LocalDateTime shelfTime;
  //该商品的上架状态
  private int shelfState;
  //该商品被购买的次数
  private int purchasedTime;
  //推荐分值。如果该商品广告推荐则会使得分值增加
  /**
   * 分值的增加：
   * 该商品被浏览一次，则增加1分值
   * 如果该商品被好评1次，则增加100分值
   * 如果该商品被差评1次，则减少100分值
   * 如果该商品被广告，则在广告时间内，分值增加10万
   */
  private long recommendScore;

  @Override
  public String toString() {
    return "Goods{" +
            "goodsId=" + goodsId +
            ", merchantId=" + merchantId +
            ", goodsType='" + goodsType + '\'' +
            ", goodsName='" + goodsName + '\'' +
            ", goodsVideo='" + goodsVideo + '\'' +
            ", goodsIntroduction='" + goodsIntroduction + '\'' +
            ", favorableCommentNumber=" + favorableCommentNumber +
            ", mediumCommentNumber=" + mediumCommentNumber +
            ", badCommentNumber=" + badCommentNumber +
            ", shelfTime=" + shelfTime +
            ", shelfState=" + shelfState +
            ", purchasedTime=" + purchasedTime +
            ", recommendScore=" + recommendScore +
            '}';
  }
}
